package com.m3839.sdk.login.ui;

import com.m3839.sdk.common.base.BaseJsInterface;
import com.m3839.sdk.common.base.BaseWebDialogFragment;
import com.m3839.sdk.common.env2.ApiManager;
import com.m3839.sdk.login.js.HykbLoginJsInterface;

/**
 * @author ChenBaoyang
 * @description: HykbLoginWebFragment
 * @date 6/9/21 17:22
 */
public class LoginWebFragment extends BaseWebDialogFragment {

    public static LoginWebFragment newInstance() {
        LoginWebFragment fragment = new LoginWebFragment();
        return fragment;
    }

    @Override
    protected void setWebContent() {
        HykbLoginJsInterface jsInterface = new HykbLoginJsInterface(getActivity());
        webView.addJavascriptInterface(jsInterface, BaseJsInterface.JS_INTERFACE_NAME);
        String url = ApiManager.getInstance().buildWebLoginUrl();
        webView.loadUrl(url);
    }
}
